#include "widget.h"
#include "ui_widget.h"
#include <QPushButton>


Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    pushButton = new QPushButton(this);
    pushButton->setText("Hello World");
    connect(Widget::pushButton,&QPushButton::clicked,this,&Widget::handleClick);
}

Widget::~Widget()
{
    delete ui;
}
void Widget::handleClick()
{
    if(pushButton->text()=="Hello World")
        pushButton->setText("hello qt");
    else
        pushButton->setText("Hello World");
}
